package com.gaojiawei.multiThread15_CopyOnWriteArrayList;

import com.sun.org.apache.xpath.internal.objects.XObject;

import java.util.concurrent.CopyOnWriteArrayList;

public class L03_CopyOnWriteArrayListRemoveSetClear {
    public static void main(String[] args) {
        CopyOnWriteArrayList<Integer> list = new CopyOnWriteArrayList<>();
        list.add(1);
        list.add(2);
        list.add(3);
        System.out.println(list);
        list.remove(0);
        System.out.println(list);
        list.remove((Object) 2);
        System.out.println(list);
        list.set(0,4);
        System.out.println(list);
        list.clear();
        System.out.println(list);
        list.add(1);
        list.add(2);

    }
}
